<?php include("header_liga_required.php"); ?>

<?php
	$connect = mysql_connect(DB_SERVER, DB_USER, DB_PWD);
	mysql_select_db(DB_CATALOG);
	
	$result = mysql_query("select te.club_id, te.team_id, te.team_name from zt_team te
		join zt_tournament t on t.tournament_id = te.tournament_id
		where t.iscurrent = 1 order by te.club_id, te.team_name");

	$teams = array();
	while ($row = mysql_fetch_assoc($result)) {
        $team = new Team;
        $team->club_id = $row['club_id'];
	    $team->team_nr = $row['team_id'];
	    $team->team_name = $row['team_name'];
	    array_push($teams, $team);
	}
?>

<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="#FFFFFF">
	<tr>
		<td id="leftFiller" valign="top" height="100%" rowspan="3" bgcolor="#666666">
			<table border="0" cellpadding="0" cellspacing="0" height="100%" width="8px">
				<tr><td>&nbsp;</td></tr>
			</table>
		</td>
		<td id="header" valign="top" width="100%">
			<table border="0" width="100%" cellpadding="3" cellspacing="0" bgcolor="#10425b">
                <tr>
                    <td bgcolor="#666666" width="40%">
                        <?php include("inc_title.html"); ?>
                    </td>
                    <td bgcolor="#666666" align="right" valign="top">&nbsp;
                          <span class="headerSmall">Huidige versie PLAYER.DBF: <?=CURRENT_PLAYER_DBF?>
                        <?php
                        if (isset($user) && $user->club_id == 100) {
                        ?>
                        <br/>
                        <a class="headerSmall" href="import_player.php">laad andere versie</a>
                        <?php
                        }
                        ?>
                        </span>
                    </td>
                </tr>
            </table>
            <table align="center" border="0" width="100%" height="90%" cellpadding="0" cellspacing="0" style="border-top:#BCDD10 4px solid;">
                <tr>
                    <?php include("inc_sublinks.php"); ?> 
                </tr>
				<tr><td colspan="2" nowrap bgcolor="#BCDD10" height="4"><img src="../../assets/images/spacer.gif" alt="" height="1" width="1"></td></tr>
				<tr>
					<td>&nbsp;</td>
					<td valign="top">
						<table align="left" cellspacing="10" width="100%">
							<tr>
								<td>
                  					<span class="blackHeaderLarge">Zilveren Toren <?=CURRENT_ZT_YEAR?>
                  					- Wijzig ploegnamen</span>
                  					<table cellpadding="2" cellspacing="0" border="0" width="50%">
										<tr>
											<td align="center"><strong>Nummer</strong></td>
											<td align="center"><strong>Naam</strong></td>
										</tr>
										<?php
										foreach ($teams as $item) {
										?>
										<tr>
											<td align="center"><?=$item->club_id?></td>
											<td>
												<input type="text" name="team_<?=$item->team_nr?>" size="60"
													value="<?=$item->team_name?>" 
													onblur="changeTeamName(this.value, <?=$item->team_nr?>, '')"/>
											</td>
										</tr>
										<?php
										}
										?>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
			</table>
		</td>
	</tr>
</table>


<?php include("footer.php"); ?>
